%filter_emg
% Allows for standard filtering. It has several possible implementations.
function [dataf] = filter_emg(data,Fs)

       %notch filter
%      Wn = [45*2/Fs,55*2/Fs]; 
%      [b,a] = butter(3,Wn,'stop');
%      data = filter(b,a,data);
    
    %notch filter
%      Wo = 50/(Fs/2);  BW = Wo/35;
%      [b,a] = iirnotch(Wo,BW);  
%      dataf = filter(b,a,data);
%    dataf = data;

 %   band pass filtering 
    [b a] = butter(4,[20 650]/(Fs/2),'bandpass');
    dataf = filtfilt(b,a,data);
    %end filtering